﻿@model Models.Comment

@{
    ViewBag.Title = "Edit Comment";
}
<script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"></script>
<h2>Edit Comment</h2>
@if (ViewBag.Message != null)
{
    @ViewBag.Message
    <span></span>
    @Html.ActionLink("Back","Index","Home",new {id = Model.NewsId.ToString()},null)
}
else
{
    using (Html.BeginForm())
     {
        @Html.ValidationSummary()
         <table id="table_admin">
             <tr>
                 <td>Title</td>
                 <td>
                     @Html.TextBoxFor(x => x.Title)
                 </td>
             </tr>
             <tr>
                 <td>Text</td>
                 <td>
                     @Html.TextAreaFor(x => x.Text)
                 </td>
             </tr>
             <td colspan="2">
                 @Html.HiddenFor(x => x.Author.Id)
                 @Html.HiddenFor(x => x.Author.Login)
                 @Html.HiddenFor(x => x.Author.Name)
                 @Html.HiddenFor(x => x.Author.Pwd)
                 @Html.HiddenFor(x => x.Author.Role)
                 @Html.HiddenFor(x => x.Author.Email)

                 @Html.HiddenFor(x => x.NewsId)
                 @Html.HiddenFor(x => x.Id)
                 @Html.HiddenFor(x => x.PublishDate)
                 <input type="submit" name="subEditComment" value="Edit"/>
             </td>
         </table>
     }
}